

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

-(void)loadView
{
    [super loadView];
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame = CGRectMake(2, 0, 44, 44);
    [backButton setBackgroundImage:[UIImage imageNamed:@"backItem"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backRootVC:) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton] ;
}
-(void)backRootVC:(UIButton*)button
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
